package Java.view.game.doudizhurule;

import java.util.Comparator;

class CountComparator implements Comparator<String> {
    private PokeGroup pokegroup;
    public CountComparator(PokeGroup pokegroup){
        this.pokegroup=pokegroup;
    }
    @Override
    public int compare(String str1, String str2) {
        int count1 =pokegroup.getCount(str1);
        int count2 =pokegroup.getCount(str2);
        return Integer.compare(count2, count1);
    }
}
